package com.springinaction.ch04.aopargsxml;

import java.util.HashMap;
import java.util.Map;


public class TrackCounter {
    private Map<Integer,Integer> trackCounts =new HashMap<Integer, Integer>();

    public void countTrack(int trackNumber){
        trackCounts.put(trackNumber,getPlayCount(trackNumber)+1);
    }
    public int getPlayCount(int trackNumber){
        return trackCounts.containsKey(trackNumber)? trackCounts.get(trackNumber):0;
    }
}
